import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AuthGuard} from "../../service/authGuard";
import {GeneratedComponent} from "./generated.component";


const routes: Routes = [
    {
        path: '',
        redirectTo: 'users',
        pathMatch: 'full',
    },
    {
        path: '',
        component: GeneratedComponent,
        canActivate: [AuthGuard],
        data: {
            title: 'Generated'
        },
        children: [
            {
                path: 'users',
                loadChildren: './user/user.module#UserModule'
            },
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class GeneratedRoutes {
}
